<?php
if(($_FILES["file"]["size"])>0)
{ 

$img="img/";
$img.=$_FILES["file"]["name"];
$img2=$_FILES["file"]["name"];

if ((($_FILES["file"]["type"] == "image/jpeg")
/*|| ($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/pjpeg")*/)
)
  {
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
    echo "Upload: " . $_FILES["file"]["name"] . "<br />";
    echo "Type: " . $_FILES["file"]["type"] . "<br />";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";

    if (file_exists("img/" . $_FILES["file"]["name"]))
      {
		  
/*     echo $_FILES["file"]["name"] . " already exists. ";
*/      }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "img/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "img/" . $_FILES["file"]["name"];
      }
    }
  }
else
  {
  echo "Invalid file";
  }
}
?> 




<?php
if(($_FILES["file"]["size"])>0)
{
$new=$img2;
   include('../include.php');
   $image = new SimpleImage();
   $image->load($img);
   $image->resize(50,50);
   $image->save($new);
	unlink($img);

}
?>



<?php
$date=$_POST["date"];
$head=$_POST["heading"];
$desc=$_POST["desc"];
$link=$_POST["link"];
$name=$_files["file"]["name"];
	$con = mysql_connect("localhost","root","");
		  
 		mysql_select_db("test", $con);

$sql="INSERT INTO  members (
`date` ,
`heading` ,
`desc` ,
`link` ,
`name`
)
VALUES
(
'$_POST[date]',
'$_POST[heading]',
'$_POST[desc]',
'$_POST[link]',
'$_POST[name]'
)";
  if (!$sql)
		  {
		  die('Could Not Complete Please Try Again Later: ' );
		  }

  //-run  the query against the mysql query function
 		 $result=mysql_query($sql);
  //-create  while loop and loop through result set
		


?>